package com.yitong.blk.services;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.yitong.blk.dao.TestUserDaoImpl;
import com.yitong.blk.domain.TestUser;

@Service
@Transactional(value = "secondTxManager", rollbackFor = Exception.class)
class TestUserServiceImpl implements TestUserService {
	private Logger logger = LoggerFactory.getLogger(getClass());
	
	@Autowired
	TestUserDaoImpl testUserDao;
	
	@Override
	public TestUser findTestByName(String name) {
		logger.info("service....");
		return testUserDao.findTestByName(name);
	}

	@Override
	public List<TestUser> getPageList(int nextPage, int pageSize) {
		logger.info("service....");
		int start = (nextPage-1)*pageSize;
		int end = nextPage*pageSize;
		List<TestUser> list=(List<TestUser>)testUserDao.getPageList(start,end);
		return list;
	}
}